<html>
<head>
	<meta charset='utf-8' />
	<title>后台管理</title>
	<meta http-equiv="keywords" content="求职,招聘,房屋,出租,出售,求租,求购,宠物,二手,二手车,二手物品,旧货,寻物,寻人,出兑,外兑"> 
	<meta http-equiv="description" content="便民信息网,房屋租售,宠物交易,二手物品,二手车辆,寻物寻人,出兑信息">  
	<meta name="description" content="便民信息网,房屋租售,宠物交易,二手物品,二手车辆,寻物寻人,出兑信息"/>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<style>
		@media screen and (max-width:450px){
			#nav_bottom{width:98%;margin:0 auto}
			#content{width:98%;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
		@media screen and (min-width:450px){
			#nav_bottom{width:450px;margin:0 auto}
			#content{width:450px;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
		.info_item{color:#444;margin:15px 0;display:flex}
		.info_item > div:last-child{flex:1}
	</style>
</head>
<body style='padding:0;margin:0;background:#eee'>
<!-- 1 Content容器 -->
<div id='Content'>
	<!-- 3 内容区-->
	<div style='margin:10px 0;word-break:break-all;padding:10px;'>

		<div style='float:right;text-align:right' onclick='After_Admin_Exit()'>退出</div>
		
		<h2 style='text-align:center;'>后台管理-用户登陆记录</h2>
		
		<div style='display:flex'>
			<div style='flex:1' id='user_id'>当前用户id：xx</div>
			<div style='border:0px solid;flex:1;text-align:right;padding-right:10px'>
				<span id='Refresh_Infinite_Fpage_Data'></span>
			</div>
		</div>

		<hr>


		<!--列表区-->
		<div id='info_list' style='text-align:center'>
			<!--div style='border-bottom:1px solid #ccc;margin:5px auto'>
				<div>登陆ip：aaa　时间：aaa</div>
			</div-->
		</div><!--列表区-->



		<div style='margin:20px auto;text-align:center;' id='fpage'></div>


		<div style='margin:20px auto;text-align:center;'>
			<button onclick='location.href="after_user.html"'>返回</button>
		</div>

	</div>	<!-- 3 内容区结束-->	
</div><!-- 1 Content容器结束 -->






<!--底部导航容器-->
<div id='Nav_Bottom' style='position:fixed;bottom:0;width:100%;height:45px'>



</body>
</html>


<script src='./Public/jquery.js'></script>
<script src='./Public/fun.js'></script>
<script>
	Check_After_User_Cookie();	//检测登陆状态
	
	var priv_name = 'after_record_login';
	Priv_Check(priv_name,function(res){
		if(res != 'ok'){
			alert('没有权限!');
			//location.href = document.referrer;
			exit;
		}
	});



	//加载底部导航栏
	Load_NavBottom('after');

	//初始化当前页
	if(!sessionStorage.after_record_login_pnow){
		sessionStorage.after_record_login_pnow = 1;
	}

	$(function(){
		Get_User_Login_Record();

		//刷新无限分页数据
		Refresh_Infinite_Fpage_Data(function(){
			sessionStorage.after_record_login_pnow = 1;
			Get_User_Login_Record();
		});
	});


	function Get_User_Login_Record(){

		var uid = GetUrlParm('uid');
		$('#user_id').text('当前用户id：'+uid);
		var type = 'After_Get_User_Login_Record';
		Token(type,function(token){
			$.ajax({
				url:url,
				type:'post',
				data:{
					token:token,
					type:type,
					uid:uid,
					pnow:sessionStorage.after_record_login_pnow
				},
				success(res){
					if(res == 'err'){
						return;
					}
					var info = JSON.parse(res);
					var data = info.data;
					var info_str = '';
					for(var i=0;i<data.length;i++){
						var t = new Date(parseInt(data[i].time)*1000);
						var time = StampToYmd(t,1);
						info_str += "<div style='font-size:15px;border-bottom:1px solid #ccc;margin:5px auto'>";
						info_str += "<div>id："+data[i].id+"　登陆ip："+data[i].ip+"　时间："+time+"</div>";
						info_str += "</div>";
					}
					$('#info_list').html(info_str);
				/*	Fpage(info.PageCount, info.PageNo,function(pnow){
						sessionStorage.after_record_login_pnow = pnow;
						//Get_User_info(uid);
						Get_User_Login_Record();
					});*/
					Fpage4(info.pnow,info.max_page,function(pnow){
						sessionStorage.after_record_login_pnow = pnow;
						Get_User_Login_Record();
					},10,3);
				}
			});
		});
	}

</script>

